﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdjustPrice.aspx.cs" Inherits="Skyworth.CRM.Web.SalesManagement.AdjustPrice" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>调价管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <%--[if IE]>
     <link href="../themes/css/ieHack.css" rel="stylesheet" type="text/css" />
    <![endif]--%>
    <link href="../themes/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/core.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/pages.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/wbox.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/Messagebox.css" rel="stylesheet" type="text/css" />

    <script src="../javascripts/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../javascripts/dwz.core.js" type="text/javascript"></script>

    <script src="../javascripts/MessageBox.js" type="text/javascript"></script>

    <script src="../javascripts/dwz.pagination.js" type="text/javascript"></script>

    <script src="../javascripts/wbox.js" type="text/javascript"></script>

    <script type="text/javascript">
        var addWindow;
        function dwzPageBreak(args) {
            $("#pageNum").val(args["pageNum"]);
            document.forms["pagerForm"].submit();
        }
        $(document).ready(function() {

            $("div.pagination").each(function() {
                var $this = $(this);
                $this.pagination({
                    targetType: $this.attr("targetType"),
                    totalCount: $this.attr("totalcount"),
                    numPerPage: $this.attr("numPerPage"),
                    pageNumShown: $this.attr("pageNumShown"),
                    currentPage: $this.attr("currentPage")
                });
            });

            if ("<%=this.orderValue.Value %>" == "asc") {
                var th = $(".tableList table.list thead th[colName='<%=this.orderField.Value %>']");
                $(th).addClass("headerSortUp");
                $(th).siblings().removeClass("headerSortUp").removeClass("headerSortDown");
            }
            else {
                var th = $(".tableList table.list thead th[colName='<%=this.orderField.Value %>']");
                $(th).addClass("headerSortDown");
                $(th).siblings().removeClass("headerSortUp").removeClass("headerSortDown");
            }

            $("#numPerPageSelect").change(function() {
                $("#pageNum").val(1);
                document.forms["pagerForm"].submit();
            })

            $("div.panelBar li, div.panelBar").hover(function() { $(this).addClass("hover"); },
                                     function() { $(this).removeClass("hover"); })

            $(".tableList table.list tbody tr").hover(function() { $(this).addClass("hover"); },
                                                function() { $(this).removeClass("hover"); }).click(function() {
                                                    $(this).addClass("selected")
                                                    $(this).siblings().removeClass("selected");
                                                    $("#selectedEmpID").val($(this).attr("rel"));
                                                    $("#selectedProductID").val($(this).attr("rel2"));
                                                }).dblclick(function() {
                                                    addWindow = $("#selectedEmpID").wBox({ title: "新增调价单信息", requestType: "iframe", target: "EditAdjustPrice.aspx?Type=update&Id=" + $(this).attr("rel") + "&ProductID=" + $(this).attr("rel2"), iframeWH: { width: 700, height: 305} });
                                                    addWindow.showBox();
                                                });
            $(".tableList table.list thead th").click(function() {
                $("#orderField").val($(this).attr("colName"));
                if ($(this).hasClass("headerSortUp")) {
                    // $(this).removeClass("headerSortUp").addClass("headerSortDown");
                    $("#orderValue").val("desc");
                }
                else {
                    // $(this).removeClass("headerSortDown").addClass("headerSortUp");
                    $("#orderValue").val("asc");
                }
                $("#pageNum").val(1);
                document.forms["pagerForm"].submit();
            })

            // init styles
            $("input[type=text], input[type=password], textarea").addClass("textInput").focusClass("focus");
            $("input[readonly], textarea[readonly]").addClass("readonly");
            $("input[disabled=true], textarea[disabled=true]").addClass("disabled");

            $("#btnUpdate").click(function() {
                if ($(this).attr("disabled") != "disabled") {
                    var empId = $("#selectedEmpID").val();
                    var pid = $("#selectedProductID").val();
                    var emp = $(".tableList table.list tbody tr.selected").length;
                    if (parseInt(empId) > 0 && emp > 0) {
                        addWindow = $("#selectedEmpID").wBox({ title: "新增调价单信息", requestType: "iframe", target: "EditAdjustPrice.aspx?Type=update&Id=" + empId + "&ProductID=" + pid, iframeWH: { width: 700, height: 305} });
                        addWindow.showBox();
                    }
                    else {
                        $.Messager.Alert({ Title: '系统消息', Message: "请选择新增的调价单！", Icon: IconType.Warning });
                    }
                    return false;
                }
            })

            $("#btnAdd").click(function() {
                if ($(this).attr("disabled") != "disabled") {
                    addWindow = $("#selectedEmpID").wBox({ title: "选择价格政策", requestType: "iframe", target: "SelectPricePolicy.aspx?", iframeWH: { width: 680, height: 350} });
                    addWindow.showBox();
                }
                return false;
            })


        })


        
    </script>

</head>
<body style="background-color: #FFF">
    <div>
        <form id="pagerForm" runat="server" method="post">
        <table width="100%">
            <tr>
                <td>
                    <div class="searchBar" style="padding: 4px 5px;">
                        <ul>
                            <li style="float: left;">
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <asp:Button ID="btnAdd" runat="server" Text="选择价格政策名称" ToolTip="选择价格政策信息" CssClass="serverButton" />
                                    </div>
                                </div>
                            </li>
                            <li style="float: left;">
                                <asp:TextBox ID="txtQueryName" runat="server"></asp:TextBox>
                            </li>
                            <li style="float: left;"><span>价格方案名称：</span>
                                <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                            </li>
                            <li style="float: left; padding-left: 20px;"><span>价格方案编码：</span>
                                <asp:TextBox ID="txtCode" runat="server"></asp:TextBox>
                            </li>
                            <li style="float: left; padding-left: 20px">
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <asp:Button ID="btnSearch" CommandArgument="5" runat="server" Text="查询" ToolTip="查询调价单信息"
                                            CssClass="serverButton" OnClick="btnSearch_Click" />
                                    </div>
                                </div>
                            </li>
                            <br style="clear: both" />
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div>
                        <div class="panelBar">
                            <ul class="toolBar">
                                <li class="">
                                    <asp:LinkButton ID="btnUpdate" CommandArgument="3" runat="server" CssClass="edit"><span>新增调价单</span> </asp:LinkButton></li>
                                <li class="line">line</li>
                                <li class="">
                                    <input type="hidden" style="display: none;" id="selectedEmpID" runat="server" />
                                    <input type="hidden" style="display: none;" id="selectedProductID" runat="server" />
                                    <input type="hidden" id="hideId" runat="server" />
                                </li>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div style="_margin-top: -2px;">
                        <div class="tableList">
                            <table class="list" width="100%">
                                <thead>
                                    <tr>
                                        <th width="100" valign="middle" style="cursor: pointer;" colname="SchemeCode">
                                            <span style="float: left">价格方案编码</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th width="100" valign="middle" style="cursor: pointer;" colname="SchemeName" class="headerSortUp">
                                            <span style="float: left">价格方案名称</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th valign="middle" style="cursor: pointer;" colname="PriceType">
                                            <span style="float: left">价格类型</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th valign="middle" style="cursor: pointer;" colname="Price">
                                            <span style="float: left">不含税单价</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th valign="middle" style="cursor: pointer;" colname="TaxRatio">
                                            <span style="float: left">税率</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th valign="middle" style="cursor: pointer;" colname="TaxPrice">
                                            <span style="float: left">含税单价</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th valign="middle" style="cursor: pointer;" colname="ProductName">
                                            <span style="float: left">产品名称</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th valign="middle" style="cursor: pointer;" colname="StartDate">
                                            <span style="float: left">开始时间</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th valign="middle" style="cursor: pointer;" colname="EndDate">
                                            <span style="float: left">结束时间</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th valign="middle" style="cursor: pointer;" colname="SpecialType">
                                            <span style="float: left">是否计入返利</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:Literal ID="EmpTableBody" runat="server"></asp:Literal>
                                </tbody>
                                <tfoot>
                                </tfoot>
                            </table>
                        </div>
                        <div class="panelBar">
                            <div class="pages">
                                <span>每页显示</span>
                                <div style="float: left">
                                    <select id="numPerPageSelect" runat="server">
                                        <option>1</option>
                                        <option>2</option>
                                        <option>15</option>
                                        <option>20</option>
                                        <option>25</option>
                                        <option selected="selected">30</option>
                                        <option>35</option>
                                        <option>40</option>
                                        <option>45</option>
                                        <option>50</option>
                                    </select>
                                </div>
                                <span>&nbsp;&nbsp;&nbsp;共【<%=totalRecords %>】条，【<%=totalPages %>】页 </span>
                            </div>
                            <div class="pagination" targettype="navTab" totalcount="<%=totalRecords %>" numperpage="<%=this.numPerPageSelect.Value %>"
                                pagenumshown="10" currentpage="<%=this.pageNum.Value %>">
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" id="pageNum" name="pageNum" value="1" runat="server" />
                    <input type="hidden" id="orderField" name="orderField" value="SchemeName" runat="server" />
                    <input type="hidden" id="orderValue" name="orderValue" value="asc" runat="server" />
                </td>
            </tr>
        </table>
        </form>
    </div>
</body>
</html>
